<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String hospitalVisitJson= (String)request.getAttribute("hospitalVisitJson");
%>
<!DOCTYPE HTML>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>解放军第三〇五医院</title>
<link rel="stylesheet" href="${basePath}/assets/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="${basePath}/assets/bootstrap/css/bootstrap-combined.min.css"/>
<link rel="stylesheet" href="${basePath}/assets/css/medical_record/print.css"/>
<script type="text/javascript" src="${basePath}/assets/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}/assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}/assets/js/print.js"></script>
</head>
<body>
    <input type="hidden" id="firstGuid" value="${firstGuid}">
	<div class="print_size" id="print_pdf"> 
			<div style="margin: 0 auto; width: 755px;">
						<ul style="padding:0px;margin:0">
						  <c:if test="${not empty scanFiles}">
							  	<c:forEach items="${scanFiles}" var="scanFile" >
									<li style="margin: 20px 0px;padding:2px;border: 1px solid #000; width:100%; position: relative;">
										<img style="width:100%;" src="${scanFile.imageUrl}">
										 <div class="text_bg">
												<ul>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												  <li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>
												</ul>
										   </div>
									</li>
								</c:forEach>
						  </c:if>
						</ul>
				</div>	
			
	</div>
	
		
			
</body>

<script type="text/javascript">

	$(function(){
			<%-- var hospitalVisitJson= <%=hospitalVisitJson%>;
			//console.log(hospitalVisitJson)
			var hospitalVisitJson = eval('(' + hospitalVisitJson + ')');
			var hospitalVisit=hospitalVisitJson.basicInfo;
			//if(JSON.stringify(hospitalVisitJson)=="{}"){
				//$("#print_pdf").html("");
			//}else{
			//住院期间治疗情况 护理 及褥疮  
			var cureInfo=hospitalVisitJson.cureInfo;
			var intensiveCareInfo=hospitalVisitJson.intensiveCareInfo;
			var nurseInfo=hospitalVisitJson.nurseInfo;
			var pressureSoreInfo=hospitalVisitJson.pressureSoreInfo;
			//病案首页基本信息
			basicdata(hospitalVisit);
			//病案首页疾病诊断
			diseaseDiagRecords(hospitalVisitJson.diseaseDiagInfo);
			//病案首页手术操作
			operateInfo(hospitalVisitJson.operateInfo.operateRecords);
			//诊断符合情况
			diagAccordRecords(cureInfo);
			//personnelCategory(hospitalVisit);
			//住院期间
			inhospitalInfo(cureInfo,nurseInfo,intensiveCareInfo,pressureSoreInfo);
			//输血品种
			infusionBloodInfo(hospitalVisitJson.infusionBloodInfo);
			//住院费用
			costRecords(hospitalVisitJson.visitCostInfo);
			//医护工作者
			cureWorkers(cureInfo);
			//console.log(cureInfo);
			//临时医嘱 
			doctorAdviceTemporaryInfo(hospitalVisitJson.doctorAdviceTemporaryInfo);
			
			addReportsRecord(hospitalVisitJson.examinationReportsInfo);
			//长期医嘱单
			doctorAdviceStandingInfo(hospitalVisitJson.doctorAdviceStandingInfo); --%>

	//}
			
		//背景水印	
/* 		var text_bg='<div class="text_bg">'+
							'<ul>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '<li><span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span>&nbsp;&nbsp;<span class="hospitalname">${hospitalName}</span>-<span class="username">${applyName}</span></li>'+
							  '</ul>'+
					' </div>';
		//病程记录单
		 var guid=$("#firstGuid").val();
		initProgressNote(guid)
		function initProgressNote(guid) {
			var url = "${basePath}medical_record/getProgressNote";
			var dataform = {"visitGuid":guid};
			$.ajax({
			    type:"get",
			    url:url,
			    dataType:"json",
			    data:dataform,
			    success:function(result){
			    	
			         if(result.success){
			               var data = result.data;
			              // console.log(data);
			               if (data != null && data.length > 0) {
			            	  var content = "";
			            	   $.each(data, function(index, htmlStr) {
			            		   content+="<div class='print_page'>"+htmlStr+text_bg+"</div>";
			            		   
			            	   });
			            	 $("#print_pdf").append(content);
			               }
			         }
			    },
			    error:function(XMLHttpRequest, textStatus, errorThrown) {
			          if(XMLHttpRequest.status == 403) {
			                 alert("没有权限!");
			          }
			    }  //error end 
			   
			}); //ajax 结束	
			
		} */
		
	}); 

</script>
</html>

